#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>

#include "hi_led.h"

int main(int argc, char *argv[] )
{
    int fd = -1;
    int c = 0;
    int tmp;
    
    fd = open("/dev/"HILED_DEVICE_NAME, O_RDONLY);
    if ( fd < 0 )
    {
        perror("open");
        return -1;
    }

    c = GEN_ST_LED_CFG(c,ST_LED_OUTPUT,ST_LED_ON, 1,ST_LED_ALARM);
    c = GEN_ST_LED_CFG(c,ST_LED_OUTPUT,ST_LED_ON, 3,ST_LED_LOCK);
    ioctl(fd, HI_LED_SET_CFG, c);
    printf("c:%d\n", c);
    read(fd, &tmp, sizeof(c));
    printf("tmp:%d\n", tmp);
    while (1);
    
    close(fd);
    return 0;
}
